/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Lily
 * Date: 2024-09-19
 * Time: 21:15
 */
public class test_2 {
    public static int findMin(int[] nums) {


        int left = 0, right = nums.length - 1;

        int x = nums[left];

        while (left < right) {
            int mid = left + (right - left+1) / 2;
            if (nums[mid] > x) {
                left = mid;
            } else {
                right = mid-1;
            }
        }

        if (left == nums.length - 1) {
            return nums[0];
        }
        return nums[left];
    }

    public static void main(String[] args) {
        int[] arr={1,2};
    }
}
